package com.firebroo.Chain;

public class test {
	public static void main(String[] args) {
		Handler handler1 = new ProjectManager();
		Handler handler2 = new DeptManager(); 
		Handler handler3 = new GeneralManager();
		handler1.setSuccessor(handler2); //项目经理的上级是部门经理
		handler2.setSuccessor(handler3); //部门经理的上级是总经理
		handler3.setSuccessor(null);     //总经理的上级上nil
		String string = handler1.handleFreeRequest("firebroo", 300);
		System.out.println(string);
		String string2 = handler1.handleFreeRequest("firebroo", 600);
		System.out.println(string2);
		String string3 = handler1.handleFreeRequest("firebroo", 1999);
		System.out.println(string3);
		String string4 = handler1.handleFreeRequest("bob", 30000);
		System.out.println(string4);
	}
}
